class Interest < ActiveRecord::Base
  belongs_to :conference
  
  def self.reorder(user, conference_ids)
    transaction do
      user.interests.destroy_all
      conference_ids.each_with_index do |conference_id, n|
        user.interests.create! :conference_id => conference_id, :position => n+1
      end
    end
  end
end
